package com.example.selectdorm.service;

import com.example.selectdorm.entity.DormitoryRoom;
import com.example.selectdorm.entity.DormitoryUnit;
import com.example.selectdorm.repo.DormitoryUnitRepository;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
@AllArgsConstructor
public class DormitoryUnitService {

    private final DormitoryUnitRepository dormitoryUnitRepository;

    public List<DormitoryUnit> findAll() {
        return dormitoryUnitRepository.findAll();
    }

    public List<DormitoryUnit> findAllByBuildingId(Long buildingId) {
        return dormitoryUnitRepository.findAllByBuildingId(buildingId);
    }

}
